package com.superman;

import java.io.Serializable;

public enum MessageType implements Serializable {
	TEXT("text"), STICKER("sticker"), IMAGE("image"), VIDEO("mv"), AUDIO("au"), LOCATION(
			"location"), CARD("card"), READ("read"), NOTI("noti"), CALLED(
			"called"), CALLING("calling"),

	UNCALLED("uncalled"),

	HANGUP("hangup"), PIC_TXT("imgtxt"), FILE("file"), DIAL("dial"), VIDEODIAL(
			"videoDial"), STOCK("stock"), VOUCHER("voucher"), POINT("point"), FEE(
			"fee"), TXT("txt");

	public String value;

	MessageType(String value) {
		this.value = value;
	}

	public static MessageType strToEnum(String str) {
		int size = MessageType.values().length;
		for (int i = 0; i < size; i++) {
			if (MessageType.values()[i].value.equals(str)) {
				return MessageType.values()[i];
			}
		}
		return null;
	}

	@Override
	public String toString() {
		return value;
	}
}
